package com.hw.protocol.tool;

import com.hw.protocol.tool.view.IndexView;
import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author : lihy
 * @date : 2024/3/11 14:21
 * description:
 */
@SpringBootApplication
public class BootScript extends AbstractJavaFxApplicationSupport {

    public static void main(String[] args) {
        launch(BootScript.class, IndexView.class, args);

    }

    @Override
    public void beforeInitialView(Stage stage, ConfigurableApplicationContext ctx) {
        super.beforeInitialView(stage, ctx);
    }

    @Override
    public void start(Stage stage) throws Exception {
        super.start(stage);

        stage.getIcons().add(new Image(BootScript.class.getResource("/images/logo.png").toExternalForm()));
        stage.setTitle("协议解析工具");

        stage.setOnCloseRequest(event -> System.exit(0));

    }
}
